/**********************************************************************************
 * Copyright (c) 2012 - 2012,  parallel, All right reserved
 * Title: com.adc.parallel.test  ExecuteThread.java 
 * @author shen  shenqiao2012@163.com 
 *  2012-11-22 下午5:28:29 
 *********************************************************************************/


package com.adc.parallel.test;

import java.util.Date;

import com.adc.parallel.constants.ThreadConstant;
import com.adc.parallel.pool.BaseExecutorThread;



public class ExecuteThread extends BaseExecutorThread<TaskDto, TaskData> {

	/**
	 * Description:  
	 * @see com.adc.parallel.pool.BaseExecutorThread#beforeOpera() 
	 */
	@Override
	public String beforeOpera() {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * Description:  
	 * @see com.adc.parallel.pool.BaseExecutorThread#afterOpera() 
	 */
	@Override
	public String afterOpera() {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * Description:  
	 * @see com.adc.parallel.pool.BaseExecutorThread#process(com.adc.parallel.dto.BaseTaskDto) 
	 */
	@Override
	public int process(TaskDto taskDto) {
		// TODO Auto-generated method stub
		System.out.println("XXX[Process]XXXX-"+taskDto.getGid()+"\t"+taskDto.getTaskData().getName()+"\t"+taskDto.getTaskData().getAge());
		try {
			Thread.sleep((long) (Math.random()*(new Date().getTime()%1000L)));
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		return ThreadConstant.EXEC_SUCCESS;
	}

	

}
